home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Games Extra 1996 September
/
Amiga Games Extra CD-ROM 9-1996.iso
/
userbox
/
publicdomain
/
prlink-0.9.5b
/
loader.bas
< prev
next >
Wrap
BASIC Source File
|
1996-07-06
|
2KB
|
77 lines
At the end of this document, there is a bootstrap program for the PET and
the 4/8 bit version of the prlink cable.
Versions for VIC, 64 and 128 can easily be made by changing lines 100-130.
Also remove line 200 for 64 and 128.
VIC-20:
99 hs=20:rem system type
100 av=32:ack=37148: rem ack (out) is cb2
110 dat=37136: rem port b
120 ddr=37138
130 sv=16:srobe=37149: rem strobe (in) is cb1
C64 and C128:
99 hs=64:rem or 128
100 av=4:ack=56576: rem ack (out) is pa2
110 dat=56577: rem port b
120 ddr=56579
130 sv=16:srobe=56589: rem strobe (in) is -flag
200
To really do the load function, change the print in line 2050 to poke.
Here is the main listing:
99 hs=201:rem system type
100 av=32:ack=59468: rem ack (out) is cb2
110 dat=59471: rem port a
120 ddr=59459
130 sv=2:srobe=59469: rem strobe (in) is ca1
199 rem *** init cb2 and ca1
200 poke ack, (peek(ack) and 254) or (128+64+32)
300 poke ddr,0:gosub 1000
310 printby
320 if by then 330
322 by=hs:gosub 1200
324 by=0:gosub 1200:gosub 1200:gosub 1200:gosub 1200
326 goto 300
330 if by=1 then gosub2000:goto300
340 print"(unknown function)":goto 300
999 rem *** receive a byte
1000 if (peek(sr) and sv) = 0 then 1000
1010 poke sr,sv
1020 by = peek(dat)
1030 i= peek(ack): i = (i or av) - (i and av) : poke ack,i
1040 return
1199 rem *** send a byte
1200 if (peek(sr) and sv) = 0 then 1200
1210 poke sr,sv
1220 poke ddr,15:poke dat,by
1230 i= peek(ack): i = (i or av) - (i and av) : poke ack,i
1240 if (peek(sr) and sv) = 0 then 1240
1250 poke sr,sv
1260 poke dat,by/16
1270 i= peek(ack): i = (i or av) - (i and av) : poke ack,i
1280 return
1300 poke ddr,0: return: rem *** back to inputs
1999 rem *** load
2000 gosub1000:print"bank"by
2010 by=0:gosub1200
2020 gosub1000:f=by:gosub1000:f=f+256*by:print"from"f
2030 gosub1000:t=by:gosub1000:t=t+256*by:print"to "t
2040 for a=f to t-1
2050 gosub1000:printa,by
2060 next
2070 return
If you want to use the PC64 cable instead, make these changes:
300 poke ddr,15:gosub1000
1030 poke ack,peek(ack) and (255-av)
1040 if (peek(sr) and sv) = 0 then 1000
1050 poke sr,sv
1060 by = peek(dat) and 240 or (by/16)
1070 poke ack,peek(ack) or av
1080 return
1230 poke ack,peek(ack) and (255-av)
1270 poke ack,peek(ack) or av
1300 return